home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
-
- $Header$
-
- Header file for Sprite to PCX conversion utilities
-
- $Log$
-
- *******************************************************************************/
-
- #define PCX_TYPE 0x697 /* PCX filetype as used by !Transltr */
-
- extern int default_pal_type; /* 0 = BBC, 1 = Desktop, 2 = file */
- extern int force_pal; /* Apply default palette to all sprites */
-
- /* Macro short hand for casting sprite pointer to header struct */
-
- #define sp_h(x) ( *((sprite_header *) (x)) )
-
- #define FINFO_ERR -1
- #define FINFO_DIR 0x1002
- #define FINFO_DATA 0x1001
-
- typedef unsigned char ubyte;
- typedef unsigned short uword;
-
- /* PCX Header block */
-
- typedef struct {
- ubyte code; /* 10 */
- ubyte version; /* 5 = V3 here */
- ubyte encoding; /* Always 1 - RLE */
- ubyte bits; /* Bits per pixel */
- uword minx, miny, maxx, maxy; /* Image area */
- uword hres; /* H resloution */
- uword vres; /* V resolution */
- ubyte palette[48]; /* Palette data (16 colour) */
- ubyte reserved; /* Set to 0 */
- ubyte planes; /* Colour planes - 1 or 4 */
- uword line_length; /* Bytes-per-line */
- uword palinfo; /* Always set to 1 */
- ubyte pad[58]; /* Pad out to 128 bytes */
- } pcx_hdr_t ;
-
- /*******************************************************************************
-
- Function Prototypes
-
- *******************************************************************************/
-
- int finfo ( char * name, int * len );
- int settype ( char * file, int type );
- void do_os_error(os_error * oserr);
- void do_c_error( int c_err );
- void do_error ( char * string, int param );
- ubyte * choose_palette ( int bpp );
- void pre_process_sprite ( sprite_area * sp_area_p, sprite_ptr sp_p,
- sprite_id * sp_id_p,
- int * bpp, int * words,
- int * w, int * h, ubyte palette[] );
- int encode_pcx ( ubyte * out_buffer, int * line_p, int width, int bpp );
- int make_pcx ( sprite_area * sp_area_p, sprite_ptr sp_p, FILE * pcxout );
- int strisnum ( char * s );
- int mkdir ( char * dir );
- sprite_ptr sprite_find ( sprite_area * sp_area_p, int number, char * name, int * new_n_p );
- int get_bpp_and_pal ( sprite_area * sp_area_p, sprite_ptr sp_p );
-